<template>
	<view class="container">

		<!-- <view style="display: flex;flex-direction: row;align-items: center;
		justify-content: space-between;margin-left: 24upx;margin-right: 24upx;margin-top: 20upx;
		border-bottom: 1px solid #e7e7e7;" >
			<view style="display: flex;flex-direction: row;align-items: center;">
				<image src="../../static/images/default-avatar.png" style="width: 60upx;height: 60upx;margin-bottom: 20upx;" mode=""></image>
				
				<view style="display: flex;flex-direction: column;margin-left: 24upx;">
					<view style="font-weight: 600;font-size: 30upx;">威客字节</view>
					<view style="margin-top: 10upx;color: #A6A6A6;font-size: 25upx;margin-bottom: 20upx;">程序员的接单平台</view>
				</view>
			</view>
			
			<view style="margin-bottom: 20upx;width: 150upx;
			height: 48upx;background-color: #6080EC;border-radius: 24upx;line-height: 48upx;
			text-align: center;color: #ffffff;font-size: 25upx;box-shadow: 1upx 1upx 1upx #000000;" @click="toPlay">去试玩</view>
			
			
		</view>
		 -->


		<view style="display: flex;flex-direction: column;background: #ffffff;margin-left: 24upx;
				margin-right: 24upx;border-radius: 24upx;margin-top: 24upx;" v-for="(item,index) in thirdResourceList" :key="index">
			<view style="display: flex;flex-direction: row;align-items: center;margin-left: 24upx;margin-right: 24upx;">
				<view style="font-weight: bold;font-size: 32upx;margin-left: 10upx;margin-top: 24upx;">{{item.name}}</view>
			</view>
			<view style="display: flex;flex-direction: row;align-items: center;
					justify-content: space-between;margin-left: 24upx;margin-right: 24upx;margin-top: 24upx;
					margin-bottom: 30upx;border-bottom: 1px solid #e7e7e7;"  v-for="(detail,index1) in item.thirdResourceEntityList" :key="index1">
				<view style="display: flex;flex-direction: row;align-items: center;">
					<image :src="detail.image"
						style="width: 60upx;height: 60upx;margin-bottom: 20upx;" mode=""></image>

					<view style="display: flex;flex-direction: column;margin-left: 24upx;">
						<view style="font-weight: 600;font-size: 30upx;">{{detail.name}}</view>
						<view style="margin-top: 10upx;color: #A6A6A6;font-size: 25upx;margin-bottom: 20upx;">{{detail.description}}
						</view>
					</view>
				</view>

				<view style="margin-bottom: 20upx;width: 150upx;
						height: 48upx;background-color: #F8D55D;border-radius: 24upx;line-height: 48upx;
						text-align: center;color: #000000;font-size: 25upx;box-shadow: 1upx 1upx 1upx #000000;"
						 @click="toPlay(detail.appId)">
						 
						 <text v-if="detail.type==='面试宝典'">去学习</text>
						 <text v-else-if="detail.type==='实用工具'">去使用</text>
						 <text v-else>去试玩</text>
				</view>
			</view>
		</view>





	</view>
</template>

<script>
	import {
		thrid_resource
	} from '../../api/third_resource.js'

	export default {
		data() {
			return {
				thirdResourceList:[]
			}
		},
		onLoad() {

		this.getThirdResource()
		},

		methods: {
			getThirdResource() {
				thrid_resource({}).then(res => {
						console.log(res)
						this.thirdResourceList=res.data
				})
			},
			toPlay(appId) {
				uni.navigateToMiniProgram({
					appId: appId,
					path: '',
					extraData: {

					},
					success(res) {
						// 打开成功
					}
				})
			},
		}
	}
</script>

<style>

</style>
